<?php


class kclass_advanced_css_style
{
	var $themeMods;
	var $backgroundColor;
	var $style = '';
	var $links = '';
	var $scripts = '';
	
	function kclass_advanced_css_style()
	{
		$this->style = "<!-- custom styles set at your backend-->\n<style type='text/css'>\n";
		$this->themeMods = get_option('mods_'.THEMENAME);
		$this->backgroundColor = $this->themeMods['background_color'];
	}
	
	#google api font-currently not in use
	function set_font($elements, $font)
	{
		if(empty($font)) return;
		$this->links .= "<link href=' http://fonts.googleapis.com/css?family=$font' rel='stylesheet' type='text/css' />\n";
		
		$font = str_replace('+',' ',$font);		
		$this->style .= $elements."{font-family: '$font';}\n";
		
	}
	
	function set_cufon_font($elements, $font)
	{
		if(empty($font)) return;
		//$this->scripts .= "<script type='text/javascript' src='".get_bloginfo('template_url')."/framework/fonts/cufon.js'></script>\n";
		$this->scripts .= "<script type='text/javascript' src='".get_bloginfo('template_url')."/framework/fonts/cufon-yui.js'></script>\n";
		$this->scripts .= "<script type='text/javascript' src='".get_bloginfo('template_url')."/framework/fonts/$font.font.js'></script>\n";
		$this->scripts .="
<script type='text/javascript'>\n
/*Cufon.replace('".$elements."',{ 

fontFamily: 'cufon',
  hover:'true',

});*/
Cufon.replace('".$elements."', {
  //fontSize:'25'
});
\n
</script>
\n
";
	}
	
	function set_element_background($elements, $color = '')
	{
		if(($color == '' && $this->backgroundColor == "") || $elements == '') return;
		
		if($color == '') $color = $this->backgroundColor;
				
		$this->style .= $elements."{background-color: #".$color."; }\n";
	}
	
	
	function set_font_color($elements, $color = '')
	{
		if(($color == '' && $this->backgroundColor == "") || $elements == '') return;
		
		if($color == '') $color = $this->backgroundColor;
		
		$this->style .= $elements."{color: #".$color."; }\n";
	}
	
	function show()
	{
		$this->style  .= "</style>\n<!-- end custom styles-->\n";
		echo $this->links;
		echo $this->scripts;
		echo $this->style;
	}
}

$k_option['custom']['styling'] = new kclass_advanced_css_style();
